package net.hn.hnms.biz.indicator.dao;

import net.hn.hnms.biz.indicator.entity.SysIndicatorBaseData;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author 智呈物联 nzw
 * @date 2022/9/19
 */
@Repository
public interface SysIndicatorBaseDataMapper extends JpaRepository<SysIndicatorBaseData,Long> {

    @Query(value = "SELECT\n" +
            "\t* \n" +
            "FROM\n" +
            "\tssys_indicator_base_data \n" +
            "WHERE\n" +
            "\tdata_status = '1' ORDER BY dict_type desc, id",nativeQuery = true)
    List<Map<String,Object>> queryAllByDataStatus();

//    @Query(value = "UPDATE ssys_indicator_base_data \n" +
//            "SET indicator_value = ?1 \n" +
//            "WHERE\n" +
//            "\tID = ?2",nativeQuery = true)
//    void upDataById(String value,Long id);
}
